// 引用网络请求中间件
import request from './../utils/request';


// 申请成为分销商
export function addAgentExamine(data) {
	return request({
		url: '/API/PC_AgentExamine/AddAgentExamine',
		method: 'POST',
		data
	})
}

// 分销商名称检查
export function CheckAgentName(params) {
	return request({
		url: '/API/PC_AgentExamine/CheckName?name=' + params.name,
		method: 'GET',
	})
}

// 申请成为分销商审核状态
export function getAgentExamineState(data) {
	return request({
		url: '/API/PC_AgentExamine/GetAsync',
		method: 'GET',
		data
	})
}

// 获取小程序个人二维码
export function getPersonQrCode() {
	return request({
		url: '/api/PCApplet/UserQRCode',
		method: 'GET',
	})
}

// 获取小程序个人短链接
export function getPersonShortLink() {
	return request({
		url: '/api/PCApplet/UserShortLink',
		method: 'GET',
	})
}

// 获取小程序分销二维码
export function getAgentCode(params) {
	return request({
		url: '/api/Agent/AgentCode?agentid=' + params.agentId,
		method: 'GET',
	})
}

// 获取小程序分销短链接
export function getShortLink(params) {
	return request({
		url: '/api/Agent/ShortLink?agentid=' + params.agentId,
		method: 'GET',
	})
}

 // 获取小程序token
export function getAgentToken() {
	return request({
		url: '/api/Agent/GetToken',
		method: 'GET',
	})
}

//获取分销列表
export function getAgentRecordList(data) {
  return request({
    method: 'post',
    url: '/api/Agent/GetAgentRecord_Applet',
    data,
  })
}

//获取分销推广人数
export function getAgentCount() {
  return request({
    method: 'get',
    url: '/api/Agent/GetAgentRecord_AppletCount',
  })
}
